import Vue from 'vue'
import App from './App'
import faicon from './components/fa-icon.vue'
import store from './plugins/store'
import ajax from './plugins/ajax'
import api from './plugins/api'
import '@/utils/vue-emoji'

Vue.component('faicon', faicon)

Vue.config.productionTip = false

App.mpType = 'app'
Vue.prototype.$store = store
Vue.prototype.$ajax = ajax
Vue.prototype.$api = api
Vue.prototype.showLoading = (msg, mask) => {
	if (typeof mask == 'undefined') mask = true;
	uni.showLoading({
		title: msg,
		mask: mask
	});
}
Vue.prototype.hideLoading = () => {
	uni.hideLoading()
}
Vue.prototype.msg = (msg) => {
	uni.showToast({
		title: msg,
		icon: 'none',
		duration: 1200
	});
}
Vue.prototype.success = (msg) => {
	uni.showToast({
		title: msg,
		icon: 'success',
		duration: 1200
	});
}

const app = new Vue({
	store,
	...App
})
app.$mount()
